<template>
  <div>
    <div >
      <table width="50%" border="0" cellpadding="0" cellspacing="1">
        <tr>
          <td width="19%" height="20" align="middle" bgcolor="#f3f3f3">
            <div align="center">名称</div>
          </td>
          <td width="81%" height="20" bgcolor="#f3f3f3">
            <div align="left">
              <input id="name" v-model="expert.name" name="expert.name" />
            </div>
          </td>
        </tr>
        <tr>
          <td height="20" align="middle" bgcolor="#f3f3f3">
            <div align="center">单位</div>
          </td>
          <td height="20" bgcolor="#f3f3f3">
            <div align="left">
              <input
                id="expert.unitname"
                v-model="expert.unitname"
                name="expert.unitname"
              />
            </div>
          </td>
        </tr>
        <tr>
          <td height="20" align="middle" bgcolor="#f3f3f3">
            <div align="center">国籍</div>
          </td>
          <td height="20" bgcolor="#f3f3f3">
            <div align="left">
              <input id="nation" v-model="expert.nation" name="expert.nation" />
            </div>
          </td>
        </tr>
        <tr>
          <td height="20" align="middle" bgcolor="#f3f3f3">
            <div align="center">性别</div>
          </td>
          <td height="20" bgcolor="#f3f3f3">
            <div align="left">
              <input id="sex" v-model="expert.sex" name="expert.sex" />
            </div>
          </td>
        </tr>
        <tr>
          <td height="20" align="middle" bgcolor="#f3f3f3">
            <div align="center">职称</div>
          </td>
          <td height="20" bgcolor="#f3f3f3">
            <div align="left">
              <input id="title" v-model="expert.title" name="expert.title" />
            </div>
          </td>
        </tr>
        <tr>
          <td height="20" align="middle" bgcolor="#f3f3f3">
            <div align="center">电话</div>
          </td>
          <td height="20" bgcolor="#f3f3f3">
            <div align="left">
              <input id="expert.tel" v-model="expert.tel" name="expert.tel" />
            </div>
          </td>
        </tr>
        <tr>
          <td height="20" align="middle" bgcolor="#f3f3f3">
            <div align="center">简介</div>
          </td>
          <td height="20" bgcolor="#f3f3f3">
            <div align="left">
              <input
                id="expert.introduction"
                v-model="expert.introduction"
                name="expert.introduction"
              />
            </div>
          </td>
        </tr>
        <tr>
          <td height="30" align="middle" bgcolor="#f3f3f3">&nbsp;</td>
          <td height="30" align="middle" bgcolor="#f3f3f3">
            <div align="left">
              <button @click="updateExpert()">修改</button>
              <input id="button22" type="reset" value="取消" name="button22" />
            </div>
          </td>
        </tr>
      </table>
    </div>
    <div id="container">
      <div id="footer">
        <p>
          <a href="http://www.ascenttech.com.cn/" target="_blank"
            >版权所有：北京亚思晟商务科技有限公司
            &copy;2004-2008|京ICP备05005681</a
          >
        </p>
      </div>
    </div>
  </div>
</template>

<script>
export default {
    data:function() {
return {
      expert:{
        expertid:'',
        uid:'',
        name:'',
        nation:'',
        sex: '',
        unitname:'',
        title:'',
        tel:'',
        introduction:''

      },
    };
},
    mounted()
    {
     this.expert=JSON.parse(localStorage.getItem("expert"));
      console.log(this.expert);
    },
    methods:{
      updateExpert:function ()
      {
        this.$axios.post(
                "http://localhost:8080/api/admin/updateExpert",
                this.expert
        )
                .then((resp)=>{
                  console.log(resp.data.code+" "+resp.data.msg);
                  location.href="/declare/admin/showExperts";
                })
      }
    }
};
</script>

<style>
</style>